// Hopfield.MathCore.h

#pragma once

using namespace System;

#ifndef _HOPFIELD_MATH_CORE_H_
#define _HOPFIELD_MATH_CORE_H_

#include "hopnet.h"
#include "ppm.h"

class HopfieldMathCore {

		static FILE* open_from;
		static FILE* save_to;
		static float msemin;
		static TPPM* PPM;
		static int col;
		static int row;
		static int Zoom;
		static char* fcname;
		static THopNet* HopNet;

	private:
		char getchar(int c);
		void makefcname(int c);

	public:
		~HopfieldMathCore();
		HopfieldMathCore();
		void ReCreate(int n);
		void SetMSEmin(float nmsemin);
		void OpenHNFile(char* fname);
		void SaveHNFile(char* fname);
		void SaveImgFile(char* fname);
		void OpenImgFile(char* fname);
		void LoadKtoY(int k);
		void PrintHN(void);
		void RandY(int p);
		void AddAttr();
		void DelAttr(int k);
		void Setd(int newd);
		void Seteta(float neweta);
		void LearnHN(char* arg);
		float LearnStepHN(char* arg);
		float CompHN(char* arg);
		void ClearW();
		void SetY(float* nY);
		float* GetY();
		int Getn();
		float** GetW();
		int Getw();
		float** GetL();
		int GetRecognizedLIndex(int count, float &mseRec);
		int Getl();
		int GetCols();
		int GetRows();
		float GetE();
        int Getd();
	};

#endif
